<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/static/js/vue.min.js"></script>
</head>
<body>
<div id="app-2">
  <span v-bind:title="message">
    鼠标悬停几第三个水电费
  </span>
    </div>
</div>

<div id="app-4">

        <li v-for="todo in todos">
            {{ todo.text }}
        </li>
</div>

<div id="app-7">
    <ol>
        <todo-item
                v-for="item in groceryList"
                v-bind:todo="item"
                v-bind:key="item.id">
        </todo-item>
    </ol>
</div>
</body>
<script>
    var app2 = new Vue({
        el: '#app-2',
        data: {
            message: 'Hello Vue!' + new Date().toLocaleDateString()
        }
    })
    var app4 = new Vue({
        el: '#app-4',
        data: {
            todos: [
                { text: '学习 JavaScript' },
                { text: '学习 Vue' },
                { text: '整个牛项目' }
            ]
        }
    })


    Vue.component('todo-item', {
        props: ['todo'],
        template: '<li>{{ todo.text }}</li>'
    })

    var app7 = new Vue({
        el: '#app-7',
        data: {
            groceryList: [
                { id: 0, text: '蔬菜' },
                { id: 1, text: '奶酪' },
                { id: 2, text: '随便其它什么人吃的东西' }
            ]
        }
    })
</script>
</html>